﻿-- Define the relationship between MarkDetails and Mark
ALTER TABLE [dbo].[MarkDetail] WITH CHECK ADD  
       CONSTRAINT [FK_MarkDetail_Mark] FOREIGN KEY([Mark])
REFERENCES [dbo].[Mark] ([MarkId])
ON DELETE NO ACTION
GO
-- Define the relationship between MarkDetails and Person
ALTER TABLE [dbo].[MarkDetail] WITH CHECK ADD  
       CONSTRAINT [FK_MarkDetail_CreatedByPerson] FOREIGN KEY([CreatedBy])
REFERENCES [dbo].[Person] ([PersonId])
ON DELETE NO ACTION
GO
-- Define the relationship between MarkDetails and Person
ALTER TABLE [dbo].[MarkDetail] WITH CHECK ADD  
       CONSTRAINT [FK_MarkDetail_LastChangedBy] FOREIGN KEY([LastChangedBy])
REFERENCES [dbo].[Person] ([PersonId])
ON DELETE NO ACTION
GO